import { request } from "@umijs/max";
import { stringify } from "qs";
//用户分页列表
export const getCustomerPage = (params: any) =>
  request(`/customer/page?${stringify(params)}`, {
    method: "GET",
  });

//用户预定订单列表
export const getOrderPage = (params: any) =>
  request(`/order/page?${stringify(params)}`, {
    method: "GET",
  });

//预定客房
export const orderRoom = (params: {
  /**
   * 身份证
   */
  identifyNum: string;
  /**
   * 预定办理入住时间
   */
  orderCheckInTime: string;
  /**
   * 真实姓名
   */
  realName: string;
  /**
   * 客房id
   */
  roomId: number;
  /**
   * 退房时间
   */
  stayEndtByTime: string;
  /**
   * 入住时间
   */
  stayStartByTime: string;
  /**
   * 电话
   */
  tel: string;
}) =>
  request(`/order/orderRoom`, {
    method: "POST",
    data: params,
  });

  //获取可选择时间
export const getOptionalTime = (params:{
  roomId:string
}) =>request(`/order/roomOptionalTime?${stringify(params)}`,{
  method:'GET'
})

//核验预定订单状态
export const checkOrderStatus = (orderNo:string) =>request(`/order/checkOrderStatus?orderNo=${orderNo}`,{
  method:'GET'
})